<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <p id="app">
        10:10:10
    </p>
    <script>
        function handleTime(value){
            if(value<10){
                return "0"+value;
            }
            return ""+value;
        }
        function showTime(){
            var app = document.getElementById("app")
            var endTime = "2020-12-04 16:50:00";
  
        endTime = new Date(endTime).getTime();
  
        var nowTime = new Date().getTime();
  
        var gapTime = endTime - nowTime;
        // console.log(gapTime)
    
        var seconds = Math.floor(gapTime/1000);
        // console.log(seconds)

        var hours = handleTime(Math.floor(seconds/3600));
        seconds = seconds % 3600;
        var minutes = handleTime(Math.floor(seconds/60));
        seconds = handleTime(seconds % 60);

        var sum =hours + ":" + minutes + ":" + seconds;
        // console.log(sum)
        app.innerHTML = sum;
        setTimeout(function(){
            showTime();
        },1000)
        }
        showTime();
        
        

/* 3700s
60*60   1h


 */

    </script>
</body>
</html>